package com.abacuslcy.ws001.service;

import java.text.SimpleDateFormat;
import java.util.Date;

import javax.jws.WebMethod;
import javax.jws.WebParam;
import javax.jws.WebResult;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;

import com.abacuslcy.ws001.type.date.DateType;

@WebService(name = "DateService", targetNamespace = "http://www.abacuslcy.com/DateService", serviceName = "DateService")
@SOAPBinding(style = SOAPBinding.Style.RPC)
public class DateService {
	@WebMethod(operationName = "getDateType", action = "getDateType", exclude = false)
	@WebResult(name = "dateType")
	public DateType getDateType(@WebParam(name = "value") long value) {
		DateType dateType = new DateType();
		Date date = new Date(value);
		dateType.setValue(value);
		dateType.setTime(date);
		SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
		dateType.setDate(format.format(date));
		return dateType;
	}

}
